import request from '@/config/axios'

// 城市合伙人-入驻码 VO
export interface PartnerCodeVO {
  id: number // 编号
  partnerCode: string // 入驻码
  expirationTime: Date // 过期时间
}

// 城市合伙人-入驻码 API
export const PartnerCodeApi = {
  // 查询城市合伙人-入驻码分页
  getPartnerCodePage: async (params: any) => {
    return await request.get({ url: `/member/partner-code/page`, params })
  },

  // 查询城市合伙人-入驻码详情
  getPartnerCode: async () => {
    return await request.get({ url: `/member/partner-code/get` })
  },

  // 新增城市合伙人-入驻码
  createPartnerCode: async (data: PartnerCodeVO) => {
    return await request.post({ url: `/member/partner-code/create`, data })
  },

  // 修改城市合伙人-入驻码
  updatePartnerCode: async (data: PartnerCodeVO) => {
    return await request.put({ url: `/member/partner-code/update`, data })
  },

  // 删除城市合伙人-入驻码
  deletePartnerCode: async (id: number) => {
    return await request.delete({ url: `/member/partner-code/delete?id=` + id })
  },
}
